﻿using System;

namespace Miao
{
    public class DelayCallHandle : Handle
    {
        internal float time;
        internal Action delayCall;

        internal DelayCallHandle(Action delayCall, float time)
        {

            onFinished += () => MiaoRuntime.Updater.RemoveDelayCall(this);
            this.delayCall = delayCall;
            this.time = time;
        }
        public void Kill()
        {
            if (running)
            {
                running = false;
                MiaoRuntime.Updater.RemoveDelayCall(this);
            }
        }
    }
}

